import React from 'react';
import Iframe from './Iframe';

export default function PDFViewer({ url = '' }) {
  if (!url.startsWith('http')) {
    url = window.location.origin + url;
  }

  return <Iframe src={`./pdfjs/web/viewer.html?file=${encodeURIComponent(url)}`} />;
}